package com.zhenai.rocyuan.modules.threadupdown;


/**
 * the tools for server
 * 
 * @author hzgk
 * 
 */
public class Utils {
	/**
	 * 楠岃瘉鐢ㄦ埛淇℃伅<br>
	 * 寰呭畬鍠�
	 * 
	 * @param user
	 * @return
	 */
	public static boolean validateUser(Users user) {
		boolean flag = false;
		if (user != null) {
			if (user.getUserName().equals("admin")) {
				flag = true;
			}
		}
		return flag;
	}

	/**
	 * 鑾峰彇鐧惧垎姣�
	 * 
	 * @param fenzi
	 * @param fenmu
	 * @return
	 */
	public static double getPercent(long fenzi, long fenmu) {
		double d = fenzi / (fenmu * 1.0);
		d = d * 100;
		return d;
	}

}
